package com.ruoyi.web.service.impl;

import com.ruoyi.web.entity.PromotionActivity;
import com.ruoyi.web.mapper.PromotionActivityMapper;
import com.ruoyi.web.service.IPromotionActivityService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lqc
 * @since 2024-01-28
 */
@Service
public class PromotionActivityServiceImpl extends ServiceImpl<PromotionActivityMapper, PromotionActivity> implements IPromotionActivityService {

    private final PromotionActivityMapper promotionActivityMapper;
    public PromotionActivityServiceImpl(PromotionActivityMapper promotionActivityMapper){
        this.promotionActivityMapper = promotionActivityMapper;
    }

    /**
     * 查询活动管理
     *
     * @param id 活动管理主键
     * @return 活动管理
     */
    @Override
    public PromotionActivity selectPromotionActivityById(Long id)
    {
        return promotionActivityMapper.selectPromotionActivityById(id);
    }

    /**
     * 查询活动管理列表
     *
     * @param promotionActivity 活动管理
     * @return 活动管理
     */
    @Override
    public List<PromotionActivity> selectPromotionActivityList(PromotionActivity promotionActivity)
    {
        return promotionActivityMapper.selectPromotionActivityList(promotionActivity);
    }

    /**
     * 新增活动管理
     *
     * @param promotionActivity 活动管理
     * @return 结果
     */
    @Override
    public int insertPromotionActivity(PromotionActivity promotionActivity)
    {
        return promotionActivityMapper.insertPromotionActivity(promotionActivity);
    }

    /**
     * 修改活动管理
     *
     * @param promotionActivity 活动管理
     * @return 结果
     */
    @Override
    public int updatePromotionActivity(PromotionActivity promotionActivity)
    {
        return promotionActivityMapper.updatePromotionActivity(promotionActivity);
    }

    /**
     * 批量删除活动管理
     *
     * @param ids 需要删除的活动管理主键
     * @return 结果
     */
    @Override
    public int deletePromotionActivityByIds(Long[] ids)
    {
        return promotionActivityMapper.deletePromotionActivityByIds(ids);
    }

    /**
     * 删除活动管理信息
     *
     * @param id 活动管理主键
     * @return 结果
     */
    @Override
    public int deletePromotionActivityById(Long id)
    {
        return promotionActivityMapper.deletePromotionActivityById(id);
    }
}
